package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the JOBHANDLERREGISTRY database table.
 * 
 */
@Embeddable
public class JobhandlerregistryPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long serverid;
	private String hostname;

    public JobhandlerregistryPK() {
    }

	@Column(unique=true, nullable=false)
	public long getServerid() {
		return this.serverid;
	}
	public void setServerid(long serverid) {
		this.serverid = serverid;
	}

	@Column(unique=true, nullable=false, length=160)
	public String getHostname() {
		return this.hostname;
	}
	public void setHostname(String hostname) {
		this.hostname = hostname;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof JobhandlerregistryPK)) {
			return false;
		}
		JobhandlerregistryPK castOther = (JobhandlerregistryPK)other;
		return 
			(this.serverid == castOther.serverid)
			&& this.hostname.equals(castOther.hostname);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.serverid ^ (this.serverid >>> 32)));
		hash = hash * prime + this.hostname.hashCode();
		
		return hash;
    }
}